<template>
  <div>
    <div class="income-list">
      <IncomeItem v-for="data in state.income" :key="data.id" :income="data" @remove-item="RemoveItem"/>
    </div>
  </div>
</template>

<script>
import IncomeItem from '@/components/IncomeItem'

export default {
  props: {
    state: Object
  },
  setup(props) {
    function RemoveItem(id) {
      // console.log(id)
      // console.log(props.state.income)
      for (let item of props.state.income) {
        if (id === item.id) {
          console.log(id + '======' + item.id)
        }
      }
    }

    return {
      RemoveItem
    }
  },
  components: {
    IncomeItem
  }
}
</script>

<style scoped>
.income-list {
  margin-top: 30px;
  padding: 15px;
}
</style>
